#version 400
#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_420pack : enable
layout (push_constant) uniform constantVals { //���ͳ�����
mat4 mvp; //���ձ任����
float landHighAdjust; //ɽ�ظ߶ȵ���ֵ
float landHighest; //ɽ�����߲�
} myConstantVals;
layout (set = 1, binding = 0) uniform sampler2D texLand; //�Ҷ�ͼ����
layout (location = 0) in vec3 pos; //����Ķ���λ��
layout (location = 1) in vec2 inTexCoor; //�������������(���)
layout (location = 2) in vec2 inLandTex; //�������������(�߶�)
layout (location = 0) out vec2 outTexCoor; //�����ƬԪ��ɫ������������(���)
layout (location = 1) out float landHeight; //�����ƬԪ��ɫ����Y ����
out gl_PerVertex { //����ӿڿ�
vec4 gl_Position; //�ڽ�����gl_Position
};
void main() {
outTexCoor = inTexCoor; //�����յ����������괫�ݵ�ƬԪ��ɫ��
vec4 gColor = textureLod(texLand, inLandTex, 0.0); //�ӻҶ�ͼ�в�������ɫֵ
float tempY = (((gColor.r + gColor.g + gColor.b) / 3.0) //ͨ���Ҷ�ͼ��ɫֵ���������Y ����
* myConstantVals.landHighest)+myConstantVals.landHighAdjust;
landHeight = tempY; //������Y ���괫�ݵ�ƬԪ��ɫ��
gl_Position = myConstantVals.mvp * vec4(pos.x,tempY,pos.z, 1);//���㶥������λ��
}